﻿using DevExpress.EntityFrameworkCore.Security;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.DC;
using DevExpress.ExpressApp.Security;
using Microsoft.EntityFrameworkCore;

namespace XAF_EFCore_Sample.Module.EFCoreObjectSpaces;

public class CustomEFCoreObjectSpace : SecuredEFCoreObjectSpace
{
    public CustomEFCoreObjectSpace(ITypesInfo typesInfo, IEntityStore entityStore, Func<DbContext> createDbContext)
        : base(typesInfo, entityStore, createDbContext)
    {
    }

    public CustomEFCoreObjectSpace(ITypesInfo typesInfo, IEntityStore entityStore, Func<DbContext> createDbContext, ISecurityStrategyBase security)
        : base(typesInfo, entityStore, createDbContext, security)
    {
    }

    public override IObjectSpace CreateNestedObjectSpace()
    {
        return new CustomEFCoreNestedObjectSpace(this);
    }
}
